Class Communities
- java.lang.Object
-
- edu.claflin.finder.logic.communities.Communities
-
public class Communities extends java.lang.Object- Author:
- Cesar Martin
-
-
Constructor Summary
Constructors Constructor Description Communities(java.util.HashMap<java.lang.Integer,java.util.List<Node>> list, Graph g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublea(java.util.List<Node> c)booleanconnectedCommunities(java.util.List<Node> c1, java.util.List<Node> c2)Communitiescopy()doublee(java.util.List<Node> c1, java.util.List<Node> c2)java.util.List<java.util.List<Node>>getList()intgetM2()intindexOfNode(Node n)voidmergeCommunities(int j, int i)Merge community j and i into jdoublemodularity()intNodesInSameCommunity(Node n1, Node n2)Determine if 2 Nodes are in the same Community.intsize()java.lang.StringtoString()java.lang.StringtoStringSorted()
-
-
-
Method Detail
-
copy
public Communities copy()
-
size
public int size()
-
getM2
public int getM2()
-
getList
public java.util.List<java.util.List<Node>> getList()
-
indexOfNode
public int indexOfNode(Node n)
-
NodesInSameCommunity
public int NodesInSameCommunity(Node n1, Node n2)
Determine if 2 Nodes are in the same Community.- Parameters:
n1- Node 1n2- Node 2- Returns:
- 1 if Nodes in same Community, 0 otherwise
-
connectedCommunities
public boolean connectedCommunities(java.util.List<Node> c1, java.util.List<Node> c2)
-
a
public double a(java.util.List<Node> c)
-
modularity
public double modularity()
-
mergeCommunities
public void mergeCommunities(int j, int i)Merge community j and i into j- Parameters:
j- the community to store the resulti- the community the offers its Nodes
-
toStringSorted
public java.lang.String toStringSorted()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-